<!-- xml version="1.0" encoding="utf-8" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
	<title>De Bello Gallico</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link href="../flashcard.css" rel="stylesheet" type="text/css">
</head>


<script type="text/javascript">
var sentences = [
  [ ["Post", "eius", "mortem", "nihilo", "minus", "Helvetii", "id,", "quod", "constituerant,"],
    ["After", "that-one’s", "death", "by-nothing", "less", "Helvetii", "that,", "which", "together-they-had-settled-upon,"] ],
  [ ["facere", "conantur,", "ut", "e", "finibus", "suis", "exeant."],
    ["to-do", "to-attempt,", "that", "from", "territories", "their-own", "out-they-go."] ],
  [ ["Vbi", "iam", "se", "ad", "eam", "rem", "paratos", "esse", "arbitrati sunt,", "oppida", "sua", "omnia,", "numero", "ad", "duodecim,"],
    ["When", "now", "themselves", "for", "that", "thing", "ready", "to-be", "they-thought,", "walled-towns", "their-own", "all,", "in-number", "to", "twelve,"] ],
  [ ["vicos", "ad", "quadringentos,", "reliqua", "privata", "aedificia", "incendunt;"],
    ["villages", "to", "four-hundred,", "remaining", "private", "buildings", "they-set-fire-to;"] ],
  [ ["frumentum", "omne,", "praeterquam", "quod", "secum", "portaturi", "erant,", "comburunt,"],
    ["grain", "all,", "further-than", "what", "themselves-with", "about-to-carry", "they-were,", "they-burn-up,"] ],
  [ ["ut", "domum", "reditionis", "spe", "sublata", "paratiores", "ad", "omnia", "pericula", "subeunda", "essent;"],
    ["that", "home", "of-return", "by-hope", "having-been-taken-away", "more-prepared", "for", "all", "dangers", "to-be-undergone", "they-might-be;"] ],
  [ ["trium", "mensum", "molita", "cibaria", "sibi", "quemque", "domo", "efferre", "iubent."],
    ["three", "months’", "ground", "provisions", "for-himself", "each-one", "from-home", "out-to-bear", "they-command."] ],
  [ ["Persuadent", "Rauracis", "et", "Tulingis", "et", "Latobrigis", "finitimis", "suis,"],
    ["They-prevail-upon", "Rauraci", "and", "Tulingi", "and", "Latobrigi", "neighbors", "their-own,"] ],
  [ ["uti", "eodem", "usi", "consilio", "oppidis", "suis", "vicisque", "exustis", "una", "cum", "eis", "proficiscantur,"],
    ["that", "that-same", "having-adopted", "plan", "walled-towns", "their-own", "villages-also", "having-been-burned-out", "together", "with", "those", "forth-they-set,"] ],
  [ ["Boiosque,", "qui", "trans", "Rhenum", "incoluerant", "et", "in", "agrum", "Noricum", "transierant", "Noreiamque", "oppugnarant,"],
    ["Boii-also,", "who", "across", "Rhine", "had-lived", "and", "into", "land", "Noric", "over-had-crossed", "Noreia-also", "had-fought-against,"] ],
  [ ["receptos", "ad", "se", "socios", "sibi", "adsciscunt."],
    ["having-been-received", "to", "themselves", "[as]_allies", "to-themselves", "they-accepted."] ]
];

var i = 0;
var j = 0;

var shown = 0;

function updateVoc() {
	
	var sentence = "";
	
	for(n = 0; n < sentences[i][0].length; n++) {
		if (n == j) {
			sentence += ' <span class="curword">' + sentences[i][0][n] + "</span>";
		} else {
			sentence += " " + sentences[i][0][n];
		}
	}
	
	document.getElementById('v3').innerHTML = sentence;
	
	if (shown == 0) {
		document.getElementById('v1').innerHTML = "";
	} else {
		document.getElementById('v1').innerHTML = sentences[i][1][j];
	}
}

function next() {
	shown++;
	if (shown > 1) {
		shown = 0;
		j++;
		if (j >= sentences[i][0].length) {
			j = 0;
			i++;
			if (i >= sentences.length) {
				i = 0;
				alert('All done!');
			}
		}
	}
	updateVoc();
}

function prev() {
	shown--;
	if (shown < 0) {
		shown = 1;
		j--;
		
		if (j < 0) {
			i--;
			if (i < 0) {
				i = sentences.length - 1;
				alert('All done!');
			}
			j = sentences[i][0].length - 1;
		}
	}
	
	updateVoc();
}

</script>

<body onload="updateVoc()">
<h1 style="text-align:center; color: #60B0C0;">Liber I - Caput V</h1>

<div class="center">
<div id="v3" class="v3"></div>
<div id="v2" class="v2">&nbsp;</div>
<div id="v1" class="v1"></div>


<a href="#" class="button" id="btnprev" onclick="prev()" accesskey="p">&lt;&lt;</a>
<a href="#" class="button" id="btnnext" onclick="next()" accesskey="n">&gt;&gt;</a>


</div>
</body>
</html>
